﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Task/Task.master" StylesheetTheme="Content"
    AutoEventWireup="true" CodeFile="UserTasksSquadron.aspx.cs" Inherits="Task_UserTasksSquadron" %>

<%@ Register Src="../UserContral/ListPageContral.ascx" TagName="ListPageContral"
    TagPrefix="uc1" %>
<asp:Content ID="Content1" runat="Server" ContentPlaceHolderID="ContentPlaceHolder1">
    <ajaxToolkit:CalendarExtender ID="CalendarExtender_StartDate" runat="server" Format="yyyy-MM-dd"
        TargetControlID="StartDate" Animated="false">
    </ajaxToolkit:CalendarExtender>
    <ajaxToolkit:CalendarExtender ID="CalendarExtender_EndDate" runat="server" Format="yyyy-MM-dd"
        TargetControlID="EndDate" Animated="false">
    </ajaxToolkit:CalendarExtender>
    <ul class="topmenu">
        <li>选择日期：<asp:TextBox ID="StartDate" runat="server" Width="90px"></asp:TextBox>
            至
            <asp:TextBox ID="EndDate" runat="server" Width="90px"></asp:TextBox></li>
        <li>
            <li>
                <asp:DropDownList ID="ddlUnit" runat="server" DataTextField="ShortName" DataValueField="DepartmentId">
                </asp:DropDownList>
            </li>
            <li>
                <asp:LinkButton ID="ButtonSearch" runat="server" OnClick="ButtonSearch_Click" Text="查询" /></li>
    </ul>
    <asp:GridView ID="UserGrid" runat="server" Caption="<span style='color:#c64411'>未上报任务列表</span>"
        DataKeyNames="TaskId,UserId" OnRowDataBound="UserGrid_RowDataBound" OnSelectedIndexChanging="UserGrid_SelectedIndexChanging"
        PageSize="20" Width="100%">
        <Columns>
            <asp:TemplateField HeaderText="序号">
                <ItemStyle HorizontalAlign="Center" />
                <HeaderStyle Width="30px" />
                <ItemTemplate>
                    <asp:Label ID="ID" runat="server" ForeColor="#666666"></asp:Label>
                </ItemTemplate>
            </asp:TemplateField>
            <asp:TemplateField HeaderText="任务名称">
                <ItemTemplate>
                    [<%# GetTaskTypeName((int)Eval("TaskType")) %>]
                    <asp:HyperLink ID="Title" ToolTip='<%# Eval("Title") %>' runat="server" NavigateUrl='<%# Eval("TaskId","ViewTask.aspx?RootId={0}") %>'
                        Text='<%# GetTitle((string)Eval("Title")) %>'>'></asp:HyperLink>
                    [<asp:Label ID="CreateUser" runat="server" Text='<%# GetDepartmentName((string)Eval("CreateDepartment")) %>'></asp:Label>]
                    <asp:Image ID="Lock" runat="server" ImageAlign="AbsMiddle" ImageUrl="../Images/Lock.gif"
                        ToolTip="任务已被用户锁定" Visible='<%# (bool)Eval("Locked") %>' />
                    <asp:Image ID="RootLock" runat="server" ImageAlign="AbsMiddle" ImageUrl="../Images/Lock.gif"
                        ToolTip="任务已被管理员锁定" Visible='<%# (bool)Eval("RootLocked") %>' />
                </ItemTemplate>
            </asp:TemplateField>
            <asp:TemplateField>
                <ItemStyle HorizontalAlign="Right" />
                <ItemTemplate>
                    <asp:HyperLink ID="ButtonEdit" runat="server" NavigateUrl='<%# "UserView.aspx?RootId="+Eval("TaskId")+"&UserId="+Eval("UserId") %>'
                        Visible='<%# !(bool)Eval("Locked") %>' Enabled='<%# !(bool)Eval("RootLocked") %>'>汇报工作</asp:HyperLink>
                    <asp:LinkButton ID="ButtonLock" runat="server" CommandName="Select" Text='<%# GetLockText((bool)Eval("Locked")) %>'
                        Visible='<%# !(bool)Eval("Locked") %>' Enabled='<%# !(bool)Eval("RootLocked") %>'></asp:LinkButton>
                </ItemTemplate>
            </asp:TemplateField>
        </Columns>
    </asp:GridView>
    <div style="padding: 4px;">
        <div style="float: left">
            <asp:Label ID="lbGridInfo" runat="server"></asp:Label>
        </div>
        <div style="float: right">
            <asp:LinkButton ID="btnFirst" runat="server" CommandArgument="First" CommandName="Page"
                OnClick="btnFirst_Click">首页</asp:LinkButton>
            <asp:LinkButton ID="btnPrev" runat="server" CommandArgument="Prev" CommandName="Page"
                OnClick="btnPrev_Click">上一页</asp:LinkButton>
            <asp:LinkButton ID="btnNext" runat="server" CommandArgument="Next" CommandName="Page"
                OnClick="btnNext_Click">下一页</asp:LinkButton>
            <asp:LinkButton ID="btnLast" runat="server" CommandArgument="Last" CommandName="Page"
                OnClick="btnLast_Click">末页</asp:LinkButton>
            转到：第
            <asp:DropDownList ID="JumpList" runat="server" AutoPostBack="True" OnSelectedIndexChanged="JumpList_SelectedIndexChanged">
            </asp:DropDownList>
            页
        </div>
    </div>
    <div class="prompt" style="clear: both">
        <asp:Label runat="server" ID="prompt" Text="说明：标题显示红色说明任务已过期！"></asp:Label>
    </div>
    <div style="clear: both; height: 30px;">
    </div>
    <asp:GridView ID="GridView1" runat="server" Caption="<span>已上报任务列表</span>" DataKeyNames="TaskId,UserId"
        OnRowDataBound="UserGrid_RowDataBound" OnSelectedIndexChanging="UserGrid_SelectedIndexChanging"
        PageSize="20" Width="100%">
        <Columns>
            <asp:TemplateField HeaderText="序号">
                <ItemStyle HorizontalAlign="Center" />
                <HeaderStyle Width="30px" />
                <ItemTemplate>
                    <asp:Label ID="ID" runat="server" ForeColor="#666666"></asp:Label>
                </ItemTemplate>
            </asp:TemplateField>
            <asp:TemplateField HeaderText="任务名称">
                <ItemTemplate>
                    [<%# GetTaskTypeName((int)Eval("TaskType")) %>]
                    <asp:HyperLink ID="Title" ToolTip='<%# Eval("Title") %>' runat="server" NavigateUrl='<%# Eval("TaskId","ViewTask.aspx?RootId={0}") %>'
                        Text='<%# GetTitle((string)Eval("Title")) %>'>'></asp:HyperLink>
                    [<asp:Label ID="CreateUser" runat="server" Text='<%# GetDepartmentName((string)Eval("CreateDepartment")) %>'></asp:Label>]
                    <asp:Image ID="Lock" runat="server" ImageAlign="AbsMiddle" ImageUrl="../Images/Lock.gif"
                        ToolTip="任务已被用户锁定" Visible='<%# (bool)Eval("Locked") %>' />
                    <asp:Image ID="RootLock" runat="server" ImageAlign="AbsMiddle" ImageUrl="../Images/Lock.gif"
                        ToolTip="任务已被管理员锁定" Visible='<%# (bool)Eval("RootLocked") %>' />[<asp:Label runat="server"
                            ID="lbSorce"></asp:Label>]
                </ItemTemplate>
            </asp:TemplateField>
            <asp:TemplateField>
                <ItemStyle HorizontalAlign="Right" />
                <ItemTemplate>
                    <asp:HyperLink ID="ButtonEdit" runat="server" NavigateUrl='<%# "UserView.aspx?RootId="+Eval("TaskId")+"&UserId="+Eval("UserId") %>'
                        Visible='<%# !(bool)Eval("Locked") %>' Enabled='<%# !(bool)Eval("RootLocked") %>'>汇报工作</asp:HyperLink>
                    <asp:LinkButton ID="ButtonLock" runat="server" CommandName="Select" Text='<%# GetLockText((bool)Eval("Locked")) %>'
                        Visible='<%# !(bool)Eval("Locked") %>' Enabled='<%# !(bool)Eval("RootLocked") %>'></asp:LinkButton>
                </ItemTemplate>
            </asp:TemplateField>
        </Columns>
    </asp:GridView>
    <uc1:ListPageContral ID="ListPageContral1" OnPageSizeChange="ListPageContral1_PageSizeChange"
        PageSize="10" runat="server" />
</asp:Content>
